/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package nextup.projeto.topnew.modelo;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.util.Collection;
public class Material implements Serializable {
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    private Integer idmaterial;
    private String tbmTipomaterial;
    private Double tbmVlrunitario;
    private Integer tbmQuantidade;
    private String tbmDescricao;
    private Collection<OrcMaterial> orcMaterialCollection;

    public Material() {
    }

    public Material(Integer idmaterial) {
        this.idmaterial = idmaterial;
    }

    public Integer getIdmaterial() {
        return idmaterial;
    }

    public void setIdmaterial(int idmaterial) {
        int oldIdmaterial = this.idmaterial;
        this.idmaterial = idmaterial;
        changeSupport.firePropertyChange("idmaterial", oldIdmaterial, idmaterial);
    }

    public String getTbmTipomaterial() {
        return tbmTipomaterial;
    }

    public void setTbmTipomaterial(String tbmTipomaterial) {
        String oldTbmTipomaterial = this.tbmTipomaterial;
        this.tbmTipomaterial = tbmTipomaterial;
        changeSupport.firePropertyChange("tbmTipomaterial", oldTbmTipomaterial, tbmTipomaterial);
    }

    public Double getTbmVlrunitario() {
        return tbmVlrunitario;
    }

    public void setTbmVlrunitario(Double tbmVlrunitario) {
        Double oldTbmVlrunitario = this.tbmVlrunitario;
        this.tbmVlrunitario = tbmVlrunitario;
        changeSupport.firePropertyChange("tbmVlrunitario", oldTbmVlrunitario, tbmVlrunitario);
    }

    public Integer getTbmQuantidade() {
        return tbmQuantidade;
    }

    public void setTbmQuantidade(Integer tbmQuantidade) {
        Integer oldTbmQuantidade = this.tbmQuantidade;
        this.tbmQuantidade = tbmQuantidade;
        changeSupport.firePropertyChange("tbmQuantidade", oldTbmQuantidade, tbmQuantidade);
    }

    public String getTbmDescricao() {
        return tbmDescricao;
    }

    public void setTbmDescricao(String tbmDescricao) {
        String oldTbmDescricao = this.tbmDescricao;
        this.tbmDescricao = tbmDescricao;
        changeSupport.firePropertyChange("tbmDescricao", oldTbmDescricao, tbmDescricao);
    }

    public Collection<OrcMaterial> getOrcMaterialCollection() {
        return orcMaterialCollection;
    }

    public void setOrcMaterialCollection(Collection<OrcMaterial> orcMaterialCollection) {
        this.orcMaterialCollection = orcMaterialCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idmaterial != null ? idmaterial.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Material)) {
            return false;
        }
        Material other = (Material) object;
        if ((this.idmaterial == null && other.idmaterial != null) || (this.idmaterial != null && !this.idmaterial.equals(other.idmaterial))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.nextup.cco_os_topnew.modelo.Material[ idmaterial=" + idmaterial + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
